www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\Label\custom_Label\留言本或信息反馈或在线订购或讨论页标签库\nd_infoback.asp

    <%'$start_ext_newDsoft 以下系统生成,勿删!
'$newDsoft_label_type$:asp_label$end_newDsoft_label_type$
'$newDsoft_label_name$:nd_infoback$end_newDsoft_label_name$
'$newDsoft_label_sql$: $end_newDsoft_label_sql$
'$newDsoft_label_params$:sys_content_type,频道栏目id,1|mustlogin,是否必须登陆后才能反馈?,3$end_newDsoft_label_params$
'$newDsoft_label_fenye_num$: $end_newDsoft_label_fenye_num$
'$newDsoft_label_beizhu$:显示 在线信息反馈 填写表单$end_newDsoft_label_beizhu$
'$newDsoft_is_sys_label$:0$end_newDsoft_is_sys_label$
'$newDsoft_other_params$:htmledxa:3|htmledxb:$end_newDsoft_other_params$
'$end_ext_newDsoft%>
<%

sys_content_type=$xxvar$sys_content_type

if sys_content_type="" then sys_content_type=request("sys_content_type")


if sys_content_type="" then sys_content_type="sys_123_root_123x"




sussd=""
if session("nd_cache_logined_user")<>"" then
sussd=session("nd_cache_logined_user")
else
if request.Cookies("nd_cc_cache_logined_user")<>"" then
sussd=request.Cookies("nd_cc_cache_logined_user")
end if
end if

uus_id="no"

if sussd<>"" then
set rs2c2m1a1=server.CreateObject("adodb.recordset")
rs2c2m1a1.open "select * from [ND_user] where [username]='"&sussd&"'",newdsoft_conn_obj,1,1



if not rs2c2m1a1.eof then
uus_id=cstr(rs2c2m1a1("id"))

end if

end if






'获取自身文件名
 aryxx     =split(Request.ServerVariables("SCRIPT_NAME"),"/")   
 fileNamexx   =   aryxx(ubound(aryxx))
strFileName=fileNamexx
set conn=newdsoft_conn_obj


function JoinChar(strUrl)
	if strUrl="" then
		JoinChar=""
		exit function
	end if
	if InStr(strUrl,"?")<len(strUrl) then 
		if InStr(strUrl,"?")>1 then
			if InStr(strUrl,"&")<len(strUrl) then 
				JoinChar=strUrl & "&"
			else
				JoinChar=strUrl
			end if
		else
			JoinChar=strUrl & "?"
		end if
	else
		JoinChar=strUrl
	end if
end function


count=15		'每页留言数


action=request.querystring("action")
id=request.querystring("kkid")
rid=request.querystring("rid")

url=Request.ServerVariables("HTTP_REFERER")



if instr(1,url,"sys_content_type=",1)=0 then
url=JoinChar(url)
url=url&"sys_content_type"&"="&sys_content_type
end if

jp="! 2秒后返回<a href="&url&">"&url&"</a><meta http-equiv=refresh content=2;URL="&url&">"

function nh(fs)
if not isnull(fs) then
	fs=replace(fs,">","&gt;")
	fs=replace(fs,"<","&lt;")
	fs=Replace(fs,CHR(32),"&nbsp;")
	fs=Replace(fs,CHR(9),"&nbsp;")
	fs=Replace(fs,CHR(34),"&quot;")
	fs=Replace(fs,CHR(39),"&#39;")
	fs=Replace(fs,CHR(13),"")
	fs=Replace(fs,CHR(10) & CHR(10),"</P><P> ")
	fs=Replace(fs,CHR(10),"<BR> ")
	nh=fs
end if
end function

function ck()

ck=false
end function

select case action






case "add"
	name=nh(trim(request.form("username")))

	face=nh(request.form("userface"))
	if face="" then face="../images/touxiang/Image7.gif"
	qq=nh(request.form("userqq"))
	email=nh(request.form("useremail"))
	home=nh(request.form("website"))
	ip=request.servervariables("remote_addr")
	
  if uus_id<>"no" and uus_id<>"" then 
nameb=name&" ,用户名:"&sussd
else
nameb=name&" (匿名用户)"
end if

        content=" 反馈标题:"&request("title")&" 反馈者:"&nameb&" <br>反馈者公司名称:"&request("company")&" <br>反馈者电话:"&request("tel")&" <br>反馈者地址:"&request("from")&"<br> 留言内容:"&request("guestcontent")


  
  
     ioioppp=1	
    If request("ccode") = "" Then
      ioioppp=0
        str= "验证码不能为空!"
    End If
    If Trim(Session("CheckCode")) = "" and session("CheckCode_r_nnnn")<>"ccc"  and ioioppp=1 Then
        ioioppp=0
        str= "你登录时间过长,请重新返回登录页面进行登录。"
    End If
    If request("ccode") <> Session("CheckCode")  and session("CheckCode_r_nnnn")<>"ccc"  and ioioppp=1   Then
     ioioppp=0
        str=   "您输入的验证码和系统产生的不一致,请重新输入。"
		
    End If



if cstr($xxvar$mustlogin)="1" and sussd="" then

     ioioppp=0
        str="您必须先登陆系统,才能执行本操作。"
end if


	
if str<>"" then

response.write str

response.write "<script language=javascript>alert('"&str&"');history.go(-1);</script>"

end if



	
	
	
	if name="" or request("guestcontent")=""  then
	response.write "姓名和反馈内容必须填写"
	
	if ioioppp=1 then
	response.write"<script language=javascript>alert('姓名和反馈内容必须填写');history.go(-1);</script>"
	end if
	
	else
	if ioioppp=1 then
	conn.execute("INSERT INTO [ND_book](sys_content_type,name,content,face,qq,email,home,ip,user_id,tttype) VALUES('"&sys_content_type&"','"&name&"','"&content&"','"&face&"','"&qq&"','"&email&"','"&home&"','"&ip&"','"&uus_id&"','"&"4"&"')")
	




























	'****************************************************
	'参数说明
	  'Subject     : 邮件标题
	  'Email       : 收件人邮件地址
	  'Content     : 邮件内容
      'is_for_qiye_mail   企业子系统不?
	'****************************************************
	
	is_for_qiye_mail=0
	  Public Function SendMailb(Subject, Email, Content)
	  '                        
	   On Error Resume Next
	   
	   SendMailb="not_suputted"
	   	biao2="[ND_sys]"
	   if is_for_qiye_mail=1 then
	   biao2="[ND_sys]"
	   

set rs22t=server.CreateObject("adodb.recordset")
rs22t.open "select top 1 * from "&biao2&" where type='config_settings_qiye'",newdsoft_conn_obj,1,1
else
set rs22t=server.CreateObject("adodb.recordset")
rs22t.open "select top 1 * from "&biao2&" where type='config_settings'",newdsoft_conn_obj,1,1
end if

     ddd1tt=rs22t("data")
      dddd12tt=split(ddd1tt,"|")
	   SiteNamexx=cstr(trim(dddd12tt(2)&" "))
	   comtype=cstr(dddd12tt(7))
       if comtype="0" then
	   SendMailb ="not_suputted"
 exit function
 end if
 LoginName=cstr(trim(dddd12tt(10)&" "))
 LoginPass=cstr(trim(dddd12tt(11)&" ")) 
 MailAddress=cstr(trim(dddd12tt(9)&" ")) 
 Fromer=cstr(trim(dddd12tt(8)&" "))
	   
	if comtype="1" then
	
		  Set jmail = Server.CreateObject("JMAIL.Message") '建立发送邮件的对象
			jmail.silent = true '屏蔽例外错误,返回FALSE跟TRUE两值j
			jmail.Charset = "GB2312" '邮件的文字编码为国标
			jmail.ContentType = "text/html" '邮件的格式为HTML格式
			jmail.AddRecipient Email '邮件收件人的地址
			jmail.From = Fromer '发件人的E-MAIL地址
			jmail.FromName = SiteNamexx
			  If LoginName <> "" And LoginPass <> "" Then
				JMail.MailServerUserName = LoginName '您的邮件服务器登录名
				JMail.MailServerPassword = LoginPass '登录密码
			  End If
		If Err Then

SendMailb ="not_suputted"
 exit function
 end if
			jmail.Subject = Subject '邮件的标题 
			JMail.Body = Content
			JMail.Priority = 1'邮件的紧急程序,1 为最快,5 为最慢, 3 为默认值
			Flagaa=jmail.Send(MailAddress) '执行邮件发送(通过邮件服务器地址)
			jmail.Close() '关闭对象
		Set JMail = Nothing
		If Flagaa Then
			SendMailb = "OK"

		Else
			SendMailb = "False"
		End If
	  Exit function 
	  
	  end if



	if comtype="2" then
	Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
	objCDOMail.From = Fromer  '邮件地址
	objCDOMail.To = Email
	objCDOMail.Subject = Subject
	objCDOMail.BodyFormat = 0 
	objCDOMail.MailFormat = 0 
	objCDOMail.Body = Content
	If Err <> 0 Then
		SendMailb="not_suputted"
	Else
		objCDOMail.Send
		If Err <> 0 Then
			SendMailb="False"
		Else
			SendMailb="OK"
		End If
	End If
	Set objCDOMail = Nothing
exit function
end if


	if comtype="3" then

	Set Mailer=Server.CreateObject("Persits.MailSender") 
	Mailer.Charset = "gb2312"
	Mailer.IsHTML = True
	Mailer.username = LoginName	'服务器上有效的用户名
	Mailer.password = LoginPass	'服务器上有效的密码
	Mailer.Priority = 1
	'Mailer.Host = 
	Mailer.Host =MailAddress
	
	Mailer.Port = 25 ' 该项可选.端口25是默认值
	Mailer.From = Fromer   '邮件地址
	Mailer.FromName = SiteNamexx ' 该项可选
	Mailer.AddAddress Email,Email
	Mailer.Subject = Subject
	Mailer.Body = Content
	If Err <> 0 Then
		SendMailb="not_suputted"
	Else
		Mailer.Send
		If Err <> 0 Then
			SendMailb="False"
		Else
			SendMailb="OK"
		End If
	End If
	Set Mailer = Nothing
exit function

end if

	if comtype="CDO.Message" then

	If Not IsObject(cdoConfig) Then
	sch = "http://schemas.microsoft.com/cdo/configuration/"
	Set cdoConfig = Server.CreateObject("CDO.Configuration")
	With cdoConfig.Fields 
		.Item(sch & "smtpserver") = MailAddress		'--SMTP 服务器


		'.Item(sch & "smtpserverport") = 25
		.Item(sch & "sendusing") = 2
		.Item(sch & "smtpaccountname") = SiteNamexx
		.Item(sch & "sendemailaddress") = Fromer
		.Item(sch & "smtpuserreplyemailaddress") = 25
		'.Item(sch & "smtpauthenticate") = cdoBasic
		.Item(sch & "sendusername") = LoginName
		.Item(sch & "sendpassword") = LoginPass
		.update 
	End With
	If Err<>0 Then
		SendMailb="False"
		exit function
	End If


	End If
	

	Set Obj = Server.CreateObject("CDO.Message") 
	With Obj 
		Set .Configuration = cdoConfig 
		.To = Email
		.Subject = Subject
		.TextBody = Content
		.Send
	End With
	Set Obj = Nothing
	Set cdoConfig = Nothing
	If Err<>0 Then
		SendMailb="False"
	Else
		SendMailb="OK"
	End If
exit function

end if

end function


'判断EMAIL是否正确
Function IsValidEmail(email)

	IsValidEmail = true
	names = Split(email, "@")
	If UBound(names) <> 1 Then
		IsValidEmail = false
		Exit Function
	End If
	For Each Name in names
		If Len(Name) <= 0 Then
			IsValidEmail = false
			Exit Function
		End If
		For i = 1 To Len(Name)
			c = LCase(Mid(Name, i, 1))
			If InStr("abcdefghijklmnopqrstuvwxyz_-.", c) <= 0 And Not IsNumeric(c) Then
				IsValidEmail = false
				Exit Function
			End If
		Next
		If Left(Name, 1) = "." Or Right(Name, 1) = "." Then
			IsValidEmail = false
			Exit Function
		End If
	Next
	If InStr(names(1), ".") <= 0 Then
		IsValidEmail = false
		Exit Function
	End If
	i = Len(names(1)) - InStrRev(names(1), ".")
	If i <> 2 And i <> 3 Then
		IsValidEmail = false
		Exit Function
	End If
	If InStr(email, "..") > 0 Then
		IsValidEmail = false
	End If

End Function



biao2="[ND_sys]"

set rs22=server.CreateObject("adodb.recordset")
rs22.open "select top 1 * from "&biao2&" where type='config_settings'",newdsoft_conn_obj,1,1

ddd1=rs22("data")
dddd12=split(ddd1,"|")


ttemail=cstr(dddd12(8))



if trim(ttemail)<>"" then
 if IsValidEmail(trim(ttemail))=true then




If Request.ServerVariables("SERVER_PORT") = "80" Then
			GetSiteUrl = "http://" & Request.ServerVariables("server_name")
		Else
			GetSiteUrl = "http://" & Request.ServerVariables("server_name") & ":" & Request.ServerVariables("SERVER_PORT")
		End If
weerbnamb = GetSiteUrl


Email=trim(ttemail)

Subject="有新的用户的在线反馈信息 (来自"&weerbnamb&")"
Contenta="有新的用户的在线反馈信息:"&content
restss=SendMailb(Subject, Email, Contenta)
if restss="not_suputted" then



response.write"<script language=javascript>alert('您已成功提交 在线反馈信息 ,\n\n但是未自动发送 反馈信息 到管理员邮箱(原因:服务器不支持邮件发送组件或管理员未在基本设置里指定邮件发送组件');</script>"



end if

if restss="OK" then

response.write"<script language=javascript>alert('您已成功提交 在线反馈信息 ,\n并成功发送 反馈信息 到本站网站管理员邮箱');</script>"
end if
if restss="False" then

response.write"<script language=javascript>alert('您已成功提交 在线反馈信息 ,\n但是发送您的 反馈信息 到网站管理员邮箱时发生错误(原因:发送失败,可能管理员在基本设置里指定的邮件登陆用户名或密码是错误的)');</script>"

end if










end if


end if





	response.write"<script language=javascript>alert('您已成功提交 在线反馈信息 ,\n现在将转向到首页');self.location='index.asp';</script>"

	
	Session("CheckCode")=""
	response.end
	end if
	end if


case else
%>
<form id="form11" action="<%=strFileName%>?action=add<%="&"%>sys_content_type=<%=sys_content_type%>" method="post" name="form11">
    <table bordercolor="#6699cc" cellspacing="0" cellpadding="0" width="600" border="0">
        <tbody>
            <tr>
                <td colspan="2"><input id="txvalue" type="hidden" name="userface" value="../images/touxiang/Image7.gif" /> <input type="hidden" size="12" name="userqq" value="0" />
                <table cellspacing="1" cellpadding="0" width="80%" align="center" border="0">
                    <tbody>
                        <tr align="left">
                            <td colspan="2" height="30">注意!!凡有 * 请正确填写,以便我们与您联系</td>
                        </tr>
                        <tr>
                            <td align="right" width="142" height="25">反馈主题:</td>
                            <td align="left" width="425" height="25"><input id="title" size="30" name="title" type="text" /> *</td>
                        </tr>
                        <tr>
                            <td align="right" height="25">您的姓名:</td>
                            <td align="left" height="25"><%if sussd="" then%><input size="10" name="username" type="text" /> <%else%><input type="hidden" name="username" value="<%=sussd%>" /> <input readonly="readonly" size="10" name="usernamexx" value="<%=sussd%>" type="text" />(此为您的用户名,您已登陆) <%end if%>*</td>
                        </tr>
                        <tr>
                            <td align="right" height="25">电子邮件:</td>
                            <td align="left" height="25"><input size="40" name="useremail" type="text" /></td>
                        </tr>
                        <tr>
                            <td align="right" height="25">公司:<br />
                            </td>
                            <td align="left" height="25"><input id="company" size="40" name="company" type="text" /> *</td>
                        </tr>
                        <tr>
                            <td align="right" height="25">电话:<br />
                            </td>
                            <td align="left" height="25"><input id="tel" size="28" name="tel" type="text" /> *</td>
                        </tr>
                        <tr>
                            <td align="right" height="25">地址:<br />
                            </td>
                            <td align="left" height="25"><input id="from" size="46" name="from" type="text" /></td>
                        </tr>
                        <tr>
                            <td align="right" height="25">反馈内容:</td>
                            <td align="left" height="25"><%="<textarea id=guestcontent name=guestcontent rows=7 cols=45></textarea>"%>*</td>
                        </tr>
                        <tr align="center">
                            <td colspan="2" height="40"></td>
                        </tr>
                    </tbody>
                </table>
                验证码: <input id="ccode" size="14" name="ccode" type="text" />&#160;&#160;请输入<a onclick="aaaz()" href="javascript:"><img id="aaxa" alt="" border="0" src="../inc/checkcode.asp" /></a> <input type="submit" name="Submit" value="提交!" /> <%

'以下这句可以防止重新返回本页后 验证码不刷新而 导致的验证码总为空 而导致的登陆不了
if session("CheckCode")="" then

'防止刷新后不行又自动不断刷新,最大重试次数限制为max_r_c_ci
max_r_c_ci=0
if session("CheckCode_r_count")="" then
session("CheckCode_r_count")=1
else
session("CheckCode_r_count")=session("CheckCode_r_count")+1
end if
if session("CheckCode_r_count")>=max_r_c_ci then
session("CheckCode_r_count")=1
session("CheckCode_r_nnnn")="ccc"
response.write "<input type='hidden' name='xxccxxzsax' value='a'>"
else

%><script language=javascript>

window.location.reload();

</script><%
end if
else

session("CheckCode_r_count")=1

end if
%></td>
            </tr>
        </tbody>
    </table>
</form>
<%end select%>